import App from './App.vue';

// 自定义指令
import directive from './directive';
// vuex
import store from './store';

// 引入全局uview-plus
import uviewPlus from 'uview-plus';

// 引入uview-plus对小程序分享的mixin封装
import mpShare from 'uview-plus/libs/mixin/mpShare';

// 国际化
import i18n from '@/i18n/index';

import { createSSRApp } from 'vue';
import '@/static/css/index.scss';
import 'uno.css';

import { initRequest } from './utils/request';

import '@/utils/interceptor';

export function createApp() {
  const app = createSSRApp(App);
  // 引入请求封装
  initRequest(app);
  app.use(store);
  app.use(uviewPlus);
  app.use(i18n);
  // 自定义指令
  directive(app);

  // #ifdef MP
  app.mixin(mpShare);
  // #endif
  return {
    app
  };
}
